<template>
  <div class="common-body-wrapper">
    <search-header
      single-width="130"
      :searchList="searchList"
      @changeHeight="toRetTable"
      @confirmSearch="toSearch"
    ></search-header>
    <div class="common-table-tree-wrapper">
      <div class="common-table-wrapper">

        <multi-fun-table
          :sortColumn='notFormatColumn'
          :orderType='sortType'
          :fixed-cols="fixedCols"
          :is-reset-table="isResetTable"
          :theads-info="theadsInfo"
          :tbodys-info="tbodysInfo"
          @handleMultiCheck="handleMultiCheck"
          @handleSortColumn="handleSortColumn"
          @searchFn="getList"
          @getNextPage="getNextPage"
        >
          <div
            class="operate-btn-group"
            slot="operateBtnGroup"
          >
            <a
              class="ake_btn ake_btn_text"
              v-if="isPermmited('PARK_EMERGENCY:LOG:SERVER:EXPORT')"
              @click.prevent="exportData()"
            >导出</a>
          </div>
          <template
            slot="tdCell"
            slot-scope="props"
          >
            <el-table-column
              :fixed="props.fixed"
              :label="props.label"
              :min-width="props.minWidth"
              :width="props.width"
              :prop="props.prop"
              :sortable="props.sortable"
            >
              <template slot-scope="scope">
                <span v-if="'reno' == props.prop">{{scope.$index+1}}</span>
                <span v-else>{{ scope.row[props.prop] }}</span>
              </template>
            </el-table-column>
          </template>
        </multi-fun-table>

        <table-pagination
          :size="total"
          :cur-page="pageNumber"
          @backData="getPagination"
        ></table-pagination>
      </div>
    </div>

  </div>
</template>

<script>
import common from "@mixins/common.js";
import stardardList from "@mixins/tables/stardardList.js";

//modal
import invokeModal from "@mixins/modal/invokeModal.js";

// 引进vue的js
import service_emergency_record from "./js/service_emergency_record.js";

export default {
  mixins: [common, stardardList, invokeModal, service_emergency_record],
  data() {
    const today = [
      new Date(moment().format("YYYY-MM-DD 00:00:00")),
      new Date(moment().format("YYYY-MM-DD 23:59:59"))
    ];
    return {
      total: 0,
      fixedCols: 0,
      searchList: [
        {
          index: 0,
          isShow: false,
          type: "select",
          name: "query_handleStatus",
          text: "处理状态",
          value: "",
          options: [
            { name: "全部", value: "" },
            { name: "未处理", value: "0" },
            { name: "已处理", value: "1" }
          ]
        },
        {
          index: 1,
          isShow: true,
          type: "text",
          name: "keyword",
          propName: "query_clientName",
          text: "关键字",
          value: ""
        },
        {
          index: 2,
          isShow: true,
          type: "datePicker",
          name: "query_time",
          text: "离线时间",
          propName: "query_validStart,query_validEnd",
          value: today,
          style: { width: "360px" }
        }
      ],
      tbodysInfo: [],
      theadsInfo: [
        {
          index: 1,
          isShow: false,
          prop: "clientName",
          text: "通讯端名称",
          minWidth: 120
        },
        {
          index: 2,
          isShow: false,
          prop: "parkName",
          text: "停车场",
          minWidth: 120
        },
        {
          index: 3,//3
          isShow: false,
          prop: "createTime",
          text: "离线时间",
          minWidth: 120
        },
        {
          index: 4,//3
          isShow: false,
          prop: "offLineDuration",
          text: "离线时长(分钟)",
          minWidth: 120
        },
        {
          index: 5,//6
          isShow: false,
          prop: "status",
          text: "重连状态",
          minWidth: 100
        },
        {
          index: 6,//5
          isShow: false,
          prop: "reconnectTime",
          text: "重连时间",
          minWidth: 120
        }
      ]
    };
  }
};
</script>
